using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.Drawing;


namespace Beauty {
	public class MenuCell: UITableViewCell  {
		
		UILabel headingLabel, subheadingLabel;
		UIImageView imageView;

		public MenuCell (NSString cellId) : base (UITableViewCellStyle.Default, cellId)
		{
			//SelectionStyle = UITableViewCellSelectionStyle.Gray;
			
			ContentView.BackgroundColor = UIColor.White;
			ContentView.Layer.BorderWidth = .6f;
			ContentView.Layer.BorderColor = UIColorExtensions.FromHexString ("#a7a7a7").CGColor;
			imageView = new UIImageView();

			headingLabel = new UILabel () {
				Font = UIFont.FromName("helvetica neue", 18f),
				TextColor = UIColor.Black,
				//BackgroundColor = UIColor.Clear,
				TextAlignment= UITextAlignment.Left
			};
			
			subheadingLabel = new UILabel () {
				Font = UIFont.FromName("AmericanTypewriter", 12f),
				TextColor = UIColor.FromRGB (38, 127, 0),
				TextAlignment = UITextAlignment.Left,
				BackgroundColor = UIColor.Clear
			};
			
			ContentView.Add (headingLabel);
			//ContentView.Add (subheadingLabel);
			//ContentView.Add (imageView);
		}

		public void UpdateCell (string caption, string subtitle, UIImage image)
		{
			imageView.Image = image;
			headingLabel.Text = caption;
			subheadingLabel.Text = subtitle;
		}

		public override void LayoutSubviews ()
		{
			base.LayoutSubviews ();
			
//			imageView.Frame = new RectangleF(ContentView.Bounds.Width - 63, 5, 33, 33);
			headingLabel.Frame = new RectangleF(15, 30, ContentView.Bounds.Width - 63, 25);
//			subheadingLabel.Frame = new RectangleF(100, 18, 100, 20);
		}
	}
}

